package client;

import server.MapleStatEffect;

import java.util.concurrent.ScheduledFuture;

public class MapleBuffStatValueHolder {

    public MapleStatEffect effect;
    public long startTime;
    public int localDuration;
    public int fromChrId;
    public int value;
    public int z;
    public ScheduledFuture<?> schedule;

    public MapleBuffStatValueHolder() {
    }

    public MapleBuffStatValueHolder(MapleStatEffect effect, long startTime, ScheduledFuture<?> schedule, int value, int localDuration, int fromChrId) {
        super();
        this.effect = effect;
        this.startTime = startTime;
        this.schedule = schedule;
        this.value = value;
        this.localDuration = localDuration;
        this.fromChrId = fromChrId;
    }

    public int getZ() {
        return z;
    }

    public void setZ(int z) {
        this.z = z;
    }

    public MapleStatEffect getEffect() {
        return effect;
    }

    public void setEffect(MapleStatEffect effect) {
        this.effect = effect;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getLocalDuration() {
        return localDuration;
    }

    public void setLocalDuration(int localDuration) {
        this.localDuration = localDuration;
    }

    public int getFromChrId() {
        return fromChrId;
    }

    public void setFromChrId(int fromChrId) {
        this.fromChrId = fromChrId;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public ScheduledFuture<?> getSchedule() {
        return schedule;
    }

    public void setSchedule(ScheduledFuture<?> schedule) {
        this.schedule = schedule;
    }
    public int getBuffLength() {
        if (localDuration < 2100000000) {
            return (localDuration - (int)(System.currentTimeMillis() - this.startTime));
        } else {
            return 2100000000;
        }
    }
}
